""" 方块定义"""
from pygame.sprite import Sprite
import pygame


class Item(Sprite):
    
    def __init__(self,screen, pysettings, tower, width):
        super(Item, self).__init__()
        self.__isChoose = False  # 条块当前是否选中
        self.screen = screen
        self.width = width
        self.height = pysettings.item_height
        self.color = (255, 0, 255)
        self.rect = pygame.Rect(tower.getNextItemPosition(self))
        tower.addItem(self)
        
    def draw_item(self):
        """ 画方块"""
        self.screen.fill(self.color,self.rect)
        
    def getChoose(self):
        """ 获取条块是否选中"""
        return self.__isChoose
    
    def setChoose(self, isChoose):
        """ 设置条块是否选中"""
        self.__isChoose = isChoose